//package com.mediacloud.app.newsmodule.fragment.baoliao.api;
//
//import android.content.Context;
//import android.text.TextUtils;
//import android.util.Log;
//
//import com.mediacloud.app.reslib.util.HTTPClient;
//import com.mediacloud.app.user.net.SSLSocketClient;
//import com.mediacloud.app.user.net.SignInterceptor;
//import com.mediacloud.app.util.ProxyUtil;
//
//import org.json.JSONObject;
//
//import java.util.Arrays;
//import java.util.Collections;
//import java.util.Map;
//import java.util.concurrent.TimeUnit;
//
//import javax.net.ssl.X509TrustManager;
//
//import io.reactivex.Observable;
//import okhttp3.OkHttpClient;
//import okhttp3.Protocol;
//import retrofit2.Call;
//import retrofit2.Retrofit;
//import retrofit2.adapter.rxjava2.RxJava2CallAdapterFactory;
//import retrofit2.converter.gson.GsonConverterFactory;
//import retrofit2.http.FieldMap;
//import retrofit2.http.FormUrlEncoded;
//import retrofit2.http.GET;
//import retrofit2.http.Header;
//import retrofit2.http.POST;
//import retrofit2.http.Path;
//
//*
// * @author wangyong
// * description :强军号接口
// * 统一一下强军号的接口获取，以后都采用这个地方去请求
//
//
//public class SpiderApi {
//
//    private volatile static ISpiderApi spiderApi;
//
//    public static ISpiderApi getSpiderApi(Context context) {
//        if (spiderApi == null) {
//            synchronized (SpiderApi.class) {
//                if (spiderApi == null) {
//                    initSpiderCmsApi(context.getApplicationContext());
//                }
//            }
//        }
//        return spiderApi;
//    }
//
//    private static void initSpiderCmsApi(Context context) {
////        String baseUrl = AppFactoryGlobalConfig.getAppServerConfigInfo(context).member_api;
//        String baseUrl = "https://api.demo.chinamcloud.cn/memberapi";
//        if (TextUtils.isEmpty(baseUrl)) {
//            Log.e("DataInvokeUtil", "initMemberApi failed spider_cms is null");
//            return;
//        }
//        OkHttpClient.Builder builder = new OkHttpClient.Builder();
//        builder.dns(new MyDns());
//        ProxyUtil.config(builder);
//        builder.protocols(Collections.unmodifiableList(Arrays.asList(Protocol.HTTP_1_1, Protocol.HTTP_2)));
//        builder.addInterceptor(new SignInterceptor());
//        builder.sslSocketFactory(SSLSocketClient.getSSLSocketFactory(), (X509TrustManager) SSLSocketClient.getTrustManager()[0]);
//        builder.hostnameVerifier(SSLSocketClient.getHostnameVerifier());
//        builder.readTimeout(HTTPClient.TIME_OUT, TimeUnit.SECONDS);
//        builder.connectTimeout(HTTPClient.TIME_OUT, TimeUnit.SECONDS);
//        Retrofit retrofit = new Retrofit.Builder().baseUrl(baseUrl + "/")
//                .addConverterFactory(GsonConverterFactory.create())
//                .addCallAdapterFactory(RxJava2CallAdapterFactory.create())
//                .client(builder.build())
//                .build();
//        spiderApi = retrofit.create(ISpiderApi.class);
//    }
//
//    public interface ISpiderApi {
//
//*
//         * 获取打卡任务列表
//
//
//        @GET("api/clockin/mission/findList")
//        Call<JSONObject> getMissionList(@Header("tenantid") String tenantId);
//
//*
//         * 军号集结打卡签到
//         *
//         * @FieldMap Map<String, String> params ,
//         * missionId:集结打卡任务ID
//         * memberId:用户ID
//
//
//        @FormUrlEncoded
//        @POST("api/clockin/sign?tenantid={tenantId}")
//        Observable<JSONObject> signMission(@Path("tenantId") String tenantId, @FieldMap Map<String, String> params);
//
//
//*
//         * 打卡排行榜
//         * missionId:集结打卡任务ID
//         * limit:查询数量，默认为10
//
//
//        @FormUrlEncoded
//        @POST("api/clockin/log/rankList?tenantid={tenantId}")
//        Observable<JSONObject> getRankList(@Path("tenantId") String tenantId, @FieldMap Map<String, String> params);
//
//    }
//}
